//
//  MSBankCardListCell.m
//  觅尚
//
//  Created by No.8 on 2019/4/26.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSBankCardListCell.h"

@implementation MSBankCardListCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    MSBankCardListCell * cell = [tableView dequeueReusableCellWithIdentifier:[MSBankCardListCell ID]];
    cell = [[MSBankCardListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[MSBankCardListCell ID]];
    cell.backgroundColor = backgroundcolor;
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMember];
        
    }
    return self;
}
- (void)setMember{
    self.photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(40 * px, 10 * px, 120 * px, 120 * px)];
    self.photoIMG.layer.cornerRadius = 60 * px;
    self.photoIMG.backgroundColor = [UIColor grayColor];
    [self addSubview:self.photoIMG];
    
    
    
    self.BankNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.photoIMG.frame) + 20 * px, self.photoIMG.y, ScreenWidth * 0.5, 60 * px)];
    self.BankNameLabel.text = @"中国银行";
    self.BankNameLabel.textAlignment = NSTextAlignmentLeft;
    self.BankNameLabel.textColor = [UIColor whiteColor];
    self.BankNameLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self addSubview:self.BankNameLabel];
    
    
    /** 银行卡号*/
    self.BankNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.BankNameLabel.x, CGRectGetMaxY(self.BankNameLabel.frame), self.BankNameLabel.width, self.BankNameLabel.height)];
    self.BankNumberLabel.textColor = [UIColor grayColor];
    self.BankNumberLabel.text = @"尾号4466储蓄卡";
    self.BankNumberLabel.textAlignment = NSTextAlignmentLeft;
    self.BankNumberLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self addSubview:self.BankNumberLabel];
    
}
-(void)setBackCardModel:(MSBackCardModel *)BackCardModel{
    _BackCardModel = BackCardModel;
    [self.photoIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",BackCardModel.userId]] placeholderImage:[UIImage imageNamed:@"我的占位图片"]];
    
    self.BankNameLabel.text = [NSString stringWithFormat:@"%@",BackCardModel.bankName];
    
    NSString *Interceptstr = [BackCardModel.cardNumber substringFromIndex:BackCardModel.cardNumber.length - 4];
    
    self.BankNumberLabel.text = [NSString stringWithFormat:@"尾号%@储蓄卡",Interceptstr];
}
+(NSString *)ID{
    return @"cell";
}
@end
